package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @Title: UserMapper
 * @Author 贾金博
 * @Package com.sky.mapper
 * @Date 2024/3/28 20:22
 * @description:
 */
@Mapper
public interface UserMapper {

    /**
     * 根据 openid来查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);


    /**
     * 插入数据
     * @param newUser
     */
    void insert(User newUser);


    @Select("select * from user where id = #{id}")
    User getById(Long userId);

    Integer countByMap(Map newUsersMap);
}
